<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>顶部导航</title>
  <link rel="stylesheet" href="/common/css/index.css">
</head>
<body>
  <!-- 顶部导航 -->
  <div class="header">
    <div class="logo">
      <img class="img" src="../images/logo.png" />
    </div>
    <div class="menu">
      <ul>
        <li data-href="/pages/index.html">
          首页
          <img class="board" src="../images/chooseIcon.png" alt="" srcset="">
        </li>
        <li data-href="/pages/introduce.html">
          介绍
          <img class="board" src="../images/chooseIcon.png" alt="" srcset="">
        </li>
        <li data-href="/pages/workstip.html">
          作品
          <img class="board" src="../images/chooseIcon.png" alt="" srcset="">
        </li>
        <li data-href="https://www.zhipin.com/gongsir/d22f85933a10bb7203J42NS4Fw~~.html?ka=position-1">
          加入我们
          <img class="board" src="../images/chooseIcon.png" alt="" srcset="">
        </li>
        <li data-href="/pages/contactus.html">
          联系我们
          <img class="board" src="../images/chooseIcon.png" alt="" srcset="">
        </li>
      </ul>
    </div>
  </div>
  
</body>
</html>

<script>
  $(document).ready(function(){
    // 导航点击
    $(".menu li").click(function (e) {
      var href = e.currentTarget.dataset.href
      e.preventDefault();
      window.location.href = href
      $(this).addClass("on");
      $(this).siblings().removeClass("on");
    })
  })
</script>


